package ead.cs.domain;

import ead.cs.domain.workflow.Status;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 *
 * @author cjayawickrema
 */
@Document(collection = "declarations")
public class Declaration {

    @Id
    private String id;
    //recipient
    private Person importer;
    //customer
    private Person exporter;
    // item description
    private String details;
    private String category;
    private boolean inflammable;
    private boolean perishable;
    private String containerType;
    private double weight;
    private double height;
    private double width;
    private double length;
    private ShipSchedule schedule;
    private Status status;
    private String reason;

    public ShipSchedule getSchedule() {
        return schedule;
    }

    public void setSchedule(ShipSchedule schedule) {
        this.schedule = schedule;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Person getImporter() {
        return importer;
    }

    public void setImporter(Person importer) {
        this.importer = importer;
    }

    public Person getExporter() {
        return exporter;
    }

    public void setExporter(Person exporter) {
        this.exporter = exporter;
    }

    public String getDetails() {
        return details;
    }

    public void setDetails(String details) {
        this.details = details;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public boolean isInflammable() {
        return inflammable;
    }

    public void setInflammable(boolean inflammable) {
        this.inflammable = inflammable;
    }

    public boolean isPerishable() {
        return perishable;
    }

    public void setPerishable(boolean perishable) {
        this.perishable = perishable;
    }

    public String getContainerType() {
        return containerType;
    }

    public void setContainerType(String containerType) {
        this.containerType = containerType;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        this.length = length;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 67 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Declaration other = (Declaration) obj;
        if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Declaration{" + "id=" + id + ", importer=" + importer + ", exporter=" + exporter + ", details=" + details + ", category=" + category + ", inflammable=" + inflammable + ", perishable=" + perishable + ", containerType=" + containerType + ", weight=" + weight + ", height=" + height + ", width=" + width + ", length=" + length + ", schedule=" + schedule + ", status=" + status + ", reason=" + reason + '}';
    }

}
